package ooday05;

import javax.swing.*;
import java.sql.SQLOutput;

public class EnumDemo {
    public static void main(String[] args) {
        Season[] seasons = Season.values();//获取所有枚举的语法
        for (int i = 0; i < seasons.length; i++) {
            System.out.println(seasons[i].getSeasonName());
            System.out.println(seasons[i].getSeasonDesc());

        }


        Season season = Season.SPRING;//获取枚举的对象
        System.out.println(season.getSeasonName());
        switch (season) {
            case SPRING:
                System.out.println(season.getSeasonName()+"很"+ season.getSeasonDesc());
                break;
            case SUMMER:
                System.out.println(season.getSeasonName()+"很"+ season.getSeasonDesc());
                break;
            case AUTUMN:
                System.out.println(season.getSeasonName()+"很"+ season.getSeasonDesc());
                break;
            case WINTER:
                System.out.println(season.getSeasonName()+"很"+ season.getSeasonDesc());
                break;
        }


    }
}
